package com.mvlove.util;

import android.content.Context;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

public class PhoneUtil {
	public static final String getPhone(Context context) {
		TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
		String phone = tm.getLine1Number();
		if(TextUtils.isEmpty(phone)){
			phone = LocalManager.getPhone(context);
		}
		if(!TextUtils.isEmpty(phone)){
			phone = phone.replaceAll("\\+", "");
		}
		return phone;
	}

	public static final String getImei(Context context) {
		TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
		return tm.getSimSerialNumber();
	}

	public static final String getModel() {
		return Build.MODEL;
	}
	
	public static final String getVersion(){
		return Build.VERSION.RELEASE;
	}
}
